]> permondes.de Git - Analog_Engine.git/blame - scripts/Damped Harmonic Osciallator scaled.AESL
a rope slides frictionlessly down the edge of a table
[Analog_Engine.git] / scripts / Damped Harmonic Osciallator scaled.AESL
CommitLineData
2faffece
P
1IDENTIFICATION DIVISION
2PROGRAM-ID Damped_Oscillator
3
4ENVIRONMENT DIVISION
5ENGINE Anabrid-THAT
6TIMEBASE 1ms
7REQUIRES COEFFICIENT 5
8REQUIRES INTEGRATOR 2
9REQUIRES INVERTER 1
10REQUIRES SUMMER 2
11
12DATA DIVISION
f25252dd 13OUTPUT OUTPUT.U y
2faffece
P
14ALIAS COEFFICIENT.1 InitialPosition
15ALIAS COEFFICIENT.2 InitialSpeed
16ALIAS COEFFICIENT.3 SpringForce
17ALIAS COEFFICIENT.4 Damping # linear to speed
18ALIAS COEFFICIENT.5 Mass # 1 / mass
19
20PROGRAM DIVISION
21# Colors being used for wiring
22# - black: y0
23# - blue: y0’
24# - green: y0’’
25# - yellow: y’’, y’
26# - red: y
27-1 -> InitialPosition -> -y0 # -initial position of the mass
28-1 -> InitialSpeed -> y0s’ # y’ is scaled to be within -1..+1
6e8a1392 29+1, y0s’, y0s’ -> Summer -> y0’
2faffece 30
6e8a1392
P
31y’’, IC:y0’ -> INTEGRATOR -> -y’
32-y’,IC:-y0 -> INTEGRATOR -> y
2faffece 33y -> SpringForce -> S*y # springforce times displacement
6e8a1392 34-y’ -> INVERTER -> y’
2faffece 35y’ -> Damping -> D*y’ # damping times speed
6e8a1392 3610:S*y, 10:D*y’ -> SUMMER -> -(Dy’+Sy)
2faffece
P
37-(Dy’+Sy) -> Mass -> -1/m*(Dy’+Sy)=y’’
38
39OPERATION DIVISION
40MODE REPEAT
41OP-TIME 57ms